// slrShapeFiles.do
// Inputs: Processed map shapefiles from NOAA: `state'.shp for each foot of SLR and state
// Outputs: `state'_id_`'ft.dta and `state'_coor_`'ft.dta
// Date last updated: 1/27/2025

// This file imports processed NOAA sea level rise (SLR) shape files for each state and separately saves the data and coordinates for each foot of SLR (0ft, 1ft, ..., 6ft) as .dta files. 
// The SLR data were converted from raw .gdb files/folders to shape files using the Python code called noaaDataToShp.py. It's necessary to have ArcGIS Pro installed to run this code.

// The raw NOAA sea level rise vectors come from https://coast.noaa.gov/slrdata/Sea_Level_Rise_Vectors/index.html, originally retrieved in August 2020 for each state in the loop below. We downloaded the `state'_slr_data_dist.zip files for each state and unzipped them.

********************************************************************************	
* Turn NOAA shape files into .dta files
********************************************************************************
// NOAA shape files created from raw using Python code noaaDataToShp.py.
// Each state's shape files are stored between separate folders of SLR

// Import processed NOAA shape files and turn into separate coordinate and data .dta files for each state
foreach state in CT DE FL GA MA MD ME NC NH NJ NY PA RI SC VA{
	disp "`state'"
	shp2dta using "$pathi\0ft\`state'.shp", data("$pathi\`state'_id_0ft") coor("$pathi\`state'_coor_0ft") replace
	shp2dta using "$pathi\1ft\`state'.shp", data("$pathi\`state'_id_1ft") coor("$pathi\`state'_coor_1ft") replace
	shp2dta using "$pathi\2ft\`state'.shp", data("$pathi\`state'_id_2ft") coor("$pathi\`state'_coor_2ft") replace
	shp2dta using "$pathi\3ft\`state'.shp", data("$pathi\`state'_id_3ft") coor("$pathi\`state'_coor_3ft") replace
	shp2dta using "$pathi\4ft\`state'.shp", data("$pathi\`state'_id_4ft") coor("$pathi\`state'_coor_4ft") replace
	shp2dta using "$pathi\5ft\`state'.shp", data("$pathi\`state'_id_5ft") coor("$pathi\`state'_coor_5ft") replace
	shp2dta using "$pathi\6ft\`state'.shp", data("$pathi\`state'_id_6ft") coor("$pathi\`state'_coor_6ft") replace
}
